Skip to content

Add mkl::linalg_svd relative Ops #1511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Add mkl::linalg_svd relative Ops #1511

wants to merge 16 commits into from

Conversation

yucai-intel
Copy link
Contributor

@yucai-intel yucai-intel commented Mar 26, 2025

  • linalg_svd
  • linalg_svd.U

@yucai-intel
Copy link
Contributor Author

yucai-intel commented Mar 27, 2025

Test cases related to complex data types fail because onednn does not support it.
image
image

@yucai-intel yucai-intel changed the title [WIP] Add mkl::linalg_svd relative Ops Add mkl::linalg_svd relative Ops Apr 9, 2025
@yucai-intel yucai-intel requested a review from CuiYifeng April 11, 2025 01:53
Copy link
Contributor

@CuiYifeng CuiYifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reactivate some skipped cases such as https://github.com/intel/torch-xpu-ops/blob/main/test/xpu/skip_list_common.py#L1397. Otherwise, CI cannot test with these svd cases.

@CuiYifeng CuiYifeng force-pushed the slogdet branch 4 times, most recently from 56cebb3 to 9ac4024 Compare April 25, 2025 08:54
@CuiYifeng CuiYifeng force-pushed the slogdet branch 2 times, most recently from e13dc4f to da85fe6 Compare May 7, 2025 05:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for MKL-based SVD operations on the XPU backend, including new composite functions and updates to native function definitions for linalg_svd and related ops. Key changes include:

  • New YAML definitions for _linalg_svd and linalg_svd (and their variants) exposing the compute_uv flag.
  • Removal of several SVD-related skip tests in the xpu test skip list.
  • New MKL-based implementation files for BatchLinearAlgebra (header and source) and updated XPU dispatch registration.

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yaml/native/native_functions.yaml Added definitions for new SVD ops and composite functions.
test/xpu/skip_list_common.py Removed skip tests for SVD float64 variants on XPU.
src/ATen/native/xpu/mkl/BatchLinearAlgebra.h Declared the svd_mkl prototype.
src/ATen/native/xpu/mkl/BatchLinearAlgebra.cpp Implemented the svd_mkl function using oneMKL calls.
src/ATen/native/xpu/BatchLinearAlgebra.cpp Registered the XPU dispatch for the SVD kernel.
Files not reviewed (1)
  • src/ATen/native/xpu/XPUFallback.template: Language not supported

@@ -9350,3 +9350,22 @@
variants: function
dispatch:
XPU: _fft_r2c_xpu_out

# This function is exposes the `compute_uv` flag, which is then used to implement `linalg.svd` and
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider correcting the grammatical error in the comment. Perhaps change 'is exposes' to 'exposes'.

Suggested change
# This function is exposes the `compute_uv` flag, which is then used to implement `linalg.svd` and
# This function exposes the `compute_uv` flag, which is then used to implement `linalg.svd` and

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants